﻿/// 显示隐藏左框架
function ControlLeft() {
    if (parent.parent.myframeset != null) {
        if (parent.myframeset.cols == "170,*") {
            parent.myframeset.cols = "0,*";
            document.getElementById('showhideleftimgid').src = "../../../../Images/Common/icon/showhideleft_c.gif";
            //更新展开信息
            XmlPost("../../../../Modules/Basic/Common/UserOnLine/UserOnLine.aspx?ShowLeftFrame=True");
        }
        else {
            parent.myframeset.cols = "170,*";
            document.getElementById('showhideleftimgid').src = "../../../../Images/Common/icon/showhideleft.gif"
            //更新展开信息
            XmlPost("../../../../Modules/Basic/Common/UserOnLine/UserOnLine.aspx?ShowLeftFrame=True");
        }
    }
}
/// 显示隐藏上框架
function ControlTop() {
    if (parent.parent.parentfram != null) {
        if (parent.parent.parentfram.rows == "80,*,1") {
            parent.parent.parentfram.rows = "0,*,1";
            document.getElementById('showhidetopimgid').src = "../../../../Images/Common/icon/showhidetop_c.gif";
            //更新展开信息
            XmlPost("../../../../Modules/Basic/Common/UserOnLine/UserOnLine.aspx?ShowTopFrame=False");
        }
        else {
            parent.parent.parentfram.rows = "80,*,1";
            document.getElementById('showhidetopimgid').src = "../../../../Images/Common/icon/showhidetop.gif";
            //更新展开信息
            XmlPost("../../../../Modules/Basic/Common/UserOnLine/UserOnLine.aspx?ShowTopFrame=True");
        }
    }
}

// 以XML求取数据
//webFileUrl:要读取的页面地址,可带参数
function XmlPost(webFileUrl) {
    try {
        // alert(webFileUrl);
        var result = "";
        var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
        xmlHttp.open("POST", webFileUrl, false);
        xmlHttp.send("");
        result = xmlHttp.responseText;
        // alert(result);
        return (result);
    }
    catch (e) {
        return ("脚本错误,未取到正确数据!");
    }
}

// 设置FieldSet高度方法，支持IE浏览器、Firefox 
// 参数1：pTableID，FieldSet内部div或table的id 
// 参数2：pFieldSetID，FieldSet的ID 
// 参数3：pImageID，图片的ID，展开或收缩后更新图片SRC 
function FieldSetVisual(pTdID, pTableID, pFieldSetID, pImageID) {
    var objTd = document.getElementById(pTdID);
    var objTable = document.getElementById(pTableID);
    var objFieldSet = document.getElementById(pFieldSetID);
    var objImage = document.getElementById(pImageID);
    if (objTable.style.display == '') {
        objTable.style.display = "none";       
        objFieldSet.style.height = 2 + "px";       
    }
    else {
        objTable.style.display = '';
        var heightTable = parseInt(objTable.offsetHeight);
        objFieldSet.style.height = 2 + heightTable + "px";
        //objTd.style.height = 2 + heightTable +  "px";       
    }
}